package com.cloud.xtools.common.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author Daixinguo
 */
@Mapper
public interface DynamicSqlMapper {
    @Select("${sql}")
    Object selectBySql(@Param("sql") String sql, @Param("params") Map<String, Object> params);
    // @Select("${sql}") 注解后可以不写 DynamicSqlMapper.xml
    // DynamicSqlMapper.xml
    // <?xml version="1.0" encoding="UTF-8"?>
    // <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
    // <mapper namespace="com.cloud.xtools.user.mapper.DynamicSqlMapper">
    //     <select id="selectBySql" parameterType="Map" resultType="Object">
    //         <![CDATA[
    //     ${sql}
    //         ]]>
    //     </select>
    // </mapper>
}
